#define PLUGIN_API_VERSION 5
+#define EXTENSION_DISABLE_VERSION_CHECK_KEY "disable-extension-version-validation"
+
typedef struct {
GDBusProxy *proxy;
} PluginData;
return ret;
}
+static gboolean
+plugin_get_version_validation_enabled (PluginObject *obj,
+ NPVariant *result)
+{
+ gboolean is_enabled = !g_settings_get_boolean (obj->settings, EXTENSION_DISABLE_VERSION_CHECK_KEY);
+ BOOLEAN_TO_NPVARIANT(is_enabled, *result);
+
+ return TRUE;
+}
+
#define METHODS \
METHOD (list_extensions) \
METHOD (get_info) \
static NPIdentifier shell_version_id;
static NPIdentifier onextension_changed_id;
static NPIdentifier onrestart_id;
+static NPIdentifier version_validation_enabled_id;
+
static bool
plugin_object_has_method (NPObject *npobj,
return (name == onextension_changed_id ||
name == onrestart_id ||
name == api_version_id ||
- name == shell_version_id);
+ name == shell_version_id ||
+ name == version_validation_enabled_id);
}
static bool
return plugin_get_api_version (obj, result);
else if (name == shell_version_id)
return plugin_get_shell_version (obj, result);
+ else if (name == version_validation_enabled_id)
+ return plugin_get_version_validation_enabled (obj, result);
else if (name == onextension_changed_id)
{
if (obj->listener)
/* this is the JS public API; it is manipulated through NPIdentifiers for speed */
api_version_id = funcs.getstringidentifier ("apiVersion");
shell_version_id = funcs.getstringidentifier ("shellVersion");
+ version_validation_enabled_id = funcs.getstringidentifier ("versionValidationEnabled");
get_info_id = funcs.getstringidentifier ("getExtensionInfo");
list_extensions_id = funcs.getstringidentifier ("listExtensions");